# @file Config.cmake.in
# @brief
#
# @copyright 2023 Lixiang Limited

set(@PROJECT_NAME@_VERSION @PROJECT_VERSION@)

@PACKAGE_INIT@

@ERTPS_PACKAGE_OPT_BIN_DIR_CONDITION@
    set_and_check(@PROJECT_NAME@_BIN_DIR "@PACKAGE_BIN_INSTALL_DIR@")
endif()
set_and_check(@PROJECT_NAME@_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(@PROJECT_NAME@_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@")

find_package(elog REQUIRED)
find_package(ecdr REQUIRED)
find_package(foonathan_memory REQUIRED)
find_package(TinyXML2 QUIET)
@ERTPS_INSTALLER_DEPS_ANCILLARY@
@ERTPS_PACKAGE_UNIX_OPT_DEPS@

if(EDDS_STATIC)
    @ERTPS_INSTALLER_OPT_DEPS@
    @ERTPS_PACKAGE_WIN32_OPT_DEPS@
    include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-static-targets.cmake)
else()
    include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-dynamic-targets.cmake OPTIONAL RESULT_VARIABLE DYNAMIC_TARGET_FILE)
    # fallback to static linking if dynamic target is missing
    if( NOT DYNAMIC_TARGET_FILE )
        @ERTPS_INSTALLER_OPT_DEPS@
        @ERTPS_PACKAGE_WIN32_OPT_DEPS@
        include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-static-targets.cmake)
    endif()
endif()

@INCLUDE_EDDS_ENTITYTARGETS@
